package com.intellagric.controller.module.ift_channel_reporting;

import com.intellagric.common.pojo.LayuiDataGridResult;
import com.intellagric.common.pojo.ResponseMessage;
import com.intellagric.pojo.IftChannelReporting;
import com.intellagric.service.iftmonitor.ift_channel_reporting.ChannelReportingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: zhy
 * @email: 1269679946@qq.com
 * @Date: 2018/10/20
 * @DESC： 通道报告信息管理
 */
@Controller
public class ChannelReportingController {

    @Autowired
    private ChannelReportingService channelReportingService;

    /**
     * 添加通道报告信息
     * @Param
     * @return ResponseMessage
     */
    @RequestMapping("/channel/reporting/add")
    @ResponseBody
    public ResponseMessage add(IftChannelReporting channelReporting) {
        return channelReportingService.addChannelReporting(channelReporting);
    }

    /**
     * 删除通道报告信息
     * @Param id
     * @return ResponseMessage
     */
    @RequestMapping("/channel/reporting/delete")
    @ResponseBody
    public ResponseMessage delete(String id) {
        return channelReportingService.deleteChannelReporting(id);
    }

    /**
     * 修改通道报告信息
     * @Param
     * @return ResponseMessage
     */
    @RequestMapping("/channel/reporting/edit")
    @ResponseBody
    public ResponseMessage edit(IftChannelReporting channelReporting) {
        return channelReportingService.editChannelReporting(channelReporting);
    }

    /**
     * 查询通道报告信息
     * @return IftChannelReporting
     */
    @RequestMapping("/channel/reporting/{id}")
    @ResponseBody
    public IftChannelReporting get(@PathVariable String id) {
        return channelReportingService.getChannelReportingById(id);
    }

    /**
     * 查询通道报告信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/channel/reporting/list")
    @ResponseBody
    public LayuiDataGridResult getList() {
        return channelReportingService.getChannelReportingList();
    }

    /**
     * 分页查询通道报告信息列表
     * @return LayuiDataGridResult
     */
    @RequestMapping("/channel/reporting/page")
    @ResponseBody
    public LayuiDataGridResult getPage(int page,int limit) {
        return channelReportingService.getChannelReportingPage(page,limit);
    }


}
